home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / quicktime / wired movies and sprites / qtwiredsprites / common files / imagecompressionutilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.3 KB  |  56 lines

  1. #ifndef _IMAGECOMPRESSIONUTILITIES_
  2. #define _IMAGECOMPRESSIONUTILITIES_
  3. #ifndef __MOVIES__
  4.     #include <Movies.h>
  5. #endif
  6. #endif
  7.  
  8. // _____________________ Image Compression Utilities _____________________ //
  9.  
  10. //OSErr CompressPictAsTransparentRLE( void );
  11. //OSErr CompressPICTResourcesAsTransparentRLE( Boolean withHitTesting );
  12. //void MakePictTransparent( PicHandle pic, RGBColor *keyColor );
  13.  
  14. // Given a QuickDraw picture, extract QuickTime compressed image data and description, if any
  15. OSErr ExtractCompressData( PicHandle thePict, Handle *dataOut, ImageDescriptionHandle *idh );
  16.  
  17.  
  18. // Utilities for compressing from various types of sources
  19.  
  20.  
  21. OSErr RecompressCompressedImageWithTransparency( ImageDescriptionHandle originalDesc, Handle originalImageData,
  22.                                                     RGBColor *keyColor, 
  23.                                                     RgnHandle limitHitTestRegion,
  24.                                                     ImageDescriptionHandle *idh, Handle * imageData );
  25. OSErr RecompressPictureWithTransparency ( PicHandle originalPicture,
  26.                                                     RGBColor *keyColor, 
  27.                                                     RgnHandle limitHitTestRegion,
  28.                                                     ImageDescriptionHandle *idh, Handle * imageData );
  29. OSErr RecompressPictureFileWithTransparency ( FSSpec * spec, 
  30.                                                     RGBColor *keyColor, 
  31.                                                     RgnHandle limitHitTestRegion,
  32.                                                     ImageDescriptionHandle *idh, Handle * imageData );
  33.  
  34. // Low-level callback procedure based routine to compress with/without transparency & hit-testing
  35.  
  36. enum {
  37.     kRecoProcInitMsg = 1,                    // message and refcon are valid
  38.     kRecoProcDisposeMsg = 2,                // message and refcon are valid
  39.     kRecoProcGetBoundsMsg = 3,                // message, bounds and refcon are valid. Proc fills in bounds with rectangle to use for compressed image.
  40.     kRecoProcDrawMsg = 4                    // message, bounds, drawingPort, portType and refcon are valid. portType is 'imag' if drawing into
  41.                                             // image GWorld, 'imap' if drawing into hit testing GWorld.
  42. };
  43.  
  44. enum {
  45.     kRecoProcOriginalImageType =             FOUR_CHAR_CODE('imag'),
  46.     kRecoProcHitTestingImageType =             FOUR_CHAR_CODE('imap')
  47. };
  48.  
  49. typedef pascal OSErr (*CompressDrawProc)( short message, Rect * bounds, GWorldPtr drawingPort, OSType drawingImageType, void * refcon );
  50.  
  51. OSErr RecompressWithTransparencyFromProc( CompressDrawProc drawProc, void * drawProcRefcon, 
  52.                                                     Boolean includeHitTesting,
  53.                                                     RGBColor *keyColor, 
  54.                                                     RgnHandle hitTestRegion,
  55.                                                     ImageDescriptionHandle *idh, Handle * imageData );
  56.